bitkeeper revision 1.825.3.9 (40648b15Z2oQl7l-e-LvK-_LuJdOVA)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Fri, 26 Mar 2004 19:57:09 +0000 (19:57 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Fri, 26 Mar 2004 19:57:09 +0000 (19:57 +0000)
console.c:
  Back to ctrl-a for console redirect but pass the sequence up and just count it.

xen/drivers/char/console.c

index 2eeb70cf89297bf46dfe4085859ece7cdb3848d1..b313f59b3a00c5ae2e84fa2ea20e0618b9835e8d 100644 (file)
@@ -227,8 +227,8 @@ long read_console_ring(unsigned long str, unsigned int count, unsigned cmd)
 static char serial_rx_ring[SERIAL_RX_SIZE];
 static unsigned int serial_rx_cons, serial_rx_prod;
 
-/* CTRL-g switches input direction between Xen and DOM0. */
-#define CTRL_G 0x07
+/* CTRL-a switches input direction between Xen and DOM0. */
+#define CTRL_A 0x01
 static int xen_rx = 1; /* FALSE => serial input passed to domain 0. */
 
 static void switch_serial_input(void)
@@ -236,7 +236,7 @@ static void switch_serial_input(void)
     static char *input_str[2] = { "DOM0", "Xen" };
     xen_rx = !xen_rx;
     printk("*** Serial input -> %s "
-           "(type 'CTRL-g' three times to switch input to %s).\n",
+           "(type 'CTRL-a' three times to switch input to %s).\n",
            input_str[xen_rx], input_str[!xen_rx]);
 }
 
@@ -264,25 +264,24 @@ static void __serial_rx(unsigned char c, struct pt_regs *regs)
 
 static void serial_rx(unsigned char c, struct pt_regs *regs)
 {
-    static int ctrl_g_count = 0;
+    static int ctrl_a_count = 0;
 
-    if ( c == CTRL_G )
+    if ( c == CTRL_A )
     {
-        /* We eat CTRL-g in groups of three to switch console input. */
-        if ( ++ctrl_g_count == 3 )
+        /* We eat CTRL-a in groups of three to switch console input. */
+        if ( ++ctrl_a_count == 3 )
         {
             switch_serial_input();
-            ctrl_g_count = 0;
+            ctrl_a_count = 0;
         }
     }
     else
     {
-        /* Flush any pending CTRL-b's. They weren't for us. */
-        for ( ; ctrl_g_count != 0; ctrl_g_count-- )
-            __serial_rx(CTRL_G, regs);
-        /* Finally process the just-received character. */
-        __serial_rx(c, regs);
+        ctrl_a_count = 0;
     }
+
+    /* Finally process the just-received character. */
+    __serial_rx(c, regs);
 }
 
 long do_console_io(int cmd, int count, char *buffer)